﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using CoastalClimbing.Code;

namespace CoastalClimbing.Auth
{
    public partial class CreateUser : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            //get the username of the newly created user
            string userName = ((CreateUserWizard)sender).UserName;

            //get the id of the newly created user using the username
            string userId = Membership.GetUser(userName).ProviderUserKey.ToString();            

            //insert the username and the userid into the main site db: coastalclimbing
            DAL.LinkUsers(userName, userId);
        }
    }
}